package com.shqcjd.preinstallglass.ui.adapter;

import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.preinstallglass.R;
import com.shqcjd.preinstallglass.model.pojo.ExpertListBean;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by sy on 2019/4/2.
 */

public class ExpertListAdapter extends BaseQuickAdapter<ExpertListBean.ItemsBean,ExpertListAdapter.ViewHolder> {

    public ExpertListAdapter() {
        super(R.layout.item_expert);
    }

    @Override
    protected void convert(ViewHolder helper, ExpertListBean.ItemsBean item) {
        helper.tv_name.setText(item.name);
        helper.tv_info.setText(item.info);
        helper.addOnClickListener(R.id.tv_name);
        helper.tv_tag.setText((helper.getAdapterPosition()+1)+"");
    }

    class ViewHolder extends BaseViewHolder {
        @BindView(R.id.tv_name)
        TextView tv_name;
        @BindView(R.id.tv_info)
        TextView tv_info;
        @BindView(R.id.tv_tag)
        TextView tv_tag;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
